package cc.mrbird.grid.service;

import cc.mrbird.common.domain.QueryRequest;
import cc.mrbird.common.domain.Tree;
import cc.mrbird.common.service.IService;
import cc.mrbird.grid.domain.GridInfo;
import cc.mrbird.management.domain.ManagementInstitutions;
import cc.mrbird.system.domain.Menu;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@CacheConfig(cacheNames = "GridInfoService")
public interface GridInfoService extends IService<GridInfo>{
    /*@Cacheable(key = "#p0.toString() + (#p1 != null ? #p1.toString() : '')")*/
    List<GridInfo> findGridInfoList(GridInfo gridInfo, QueryRequest request);

    GridInfo findByName(String grid_name);
    @CacheEvict(allEntries = true)
    void add(GridInfo gridInfo);
    @CacheEvict(key = "#p0", allEntries = true)
    void updateMana(GridInfo gridInfo);
    @Cacheable(key = "#p0")
    GridInfo findById(Long id);
    @CacheEvict(key = "#p0", allEntries = true)
    void deleteMana(String ids);

    boolean batchImport(String fileName, MultipartFile file) throws Exception;

    Tree<GridInfo> getGridTree();

    List<GridInfo> findAllGrids();
}
